package com.javase.data.structure.stack.linked;

import java.util.LinkedList;

/**
 * 栈链式实现(业务实现)
 *
 * @author wangsh
 * @date 2018/11/18 17:46.
 */
public class StackLinkedList {
    /**
     * 栈：链式结构实现
     */
    private LinkedList<Object> linkedList = new LinkedList<Object>();

    public void push(Object o) {
        linkedList.addFirst(o);
    }

    public Object pop() {
        return linkedList.removeFirst();
    }

    public Object peek() {
        return linkedList.getFirst();
    }

    public boolean empty() {

        return linkedList.isEmpty();
    }
}
